<?php

/**
 * JugadorDePartido filter form base class.
 *
 * @package    ehockey
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseJugadorDePartidoFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'partido_id'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'jugador_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Jugador'), 'add_empty' => true)),
      'numero_de_camiseta' => new sfWidgetFormFilterInput(),
      'jugo'               => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'verdes'             => new sfWidgetFormFilterInput(),
      'amarillas'          => new sfWidgetFormFilterInput(),
      'rojas'              => new sfWidgetFormFilterInput(),
      'goles'              => new sfWidgetFormFilterInput(),
      'tipo'               => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'partido_id'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'jugador_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Jugador'), 'column' => 'id')),
      'numero_de_camiseta' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'jugo'               => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'verdes'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'amarillas'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rojas'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'goles'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'tipo'               => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('jugador_de_partido_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'JugadorDePartido';
  }

  public function getFields()
  {
    return array(
      'id'                 => 'Number',
      'partido_id'         => 'Number',
      'jugador_id'         => 'ForeignKey',
      'numero_de_camiseta' => 'Number',
      'jugo'               => 'Boolean',
      'verdes'             => 'Number',
      'amarillas'          => 'Number',
      'rojas'              => 'Number',
      'goles'              => 'Number',
      'tipo'               => 'Text',
    );
  }
}
